package cn.edu.fzu.delivery.filter;

import java.util.List;

import cn.edu.fzu.delivery.filter.impl.DeliveredFilter;
import cn.edu.fzu.delivery.filter.impl.SameDestinationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.google.common.collect.ImmutableList;

/**
 * @author fangxin
 * @date 2022年11月9日
 */
@Configuration
public class FilterConfig {

    private final List<DeliveryFilter> deliveryFilters;

    @Autowired
    public FilterConfig(DeliveredFilter deliveredFilter, SameDestinationFilter sameDestinationFilter) {
        this.deliveryFilters = ImmutableList.of(deliveredFilter, sameDestinationFilter);
    }


    @Bean("deliveryFilters")
    public List<DeliveryFilter> deliveryFilters() {
        return deliveryFilters;
    }

}
